import { SourceMap } from "node:module";

const sm = new SourceMap({
  version: 3,
  file: "rxjs-marble-testing.spec.d.ts",
  sourceRoot: "",
  sources: ["rxjs-marble-testing.spec.ts"],
  names: [] as string[],
  mappings: "",
  sourcesContent: [
    `import { expect, it } from "@rstest/core";
import { throttleTime } from "rxjs";
import { TestScheduler } from "rxjs/testing";

const testScheduler = new TestScheduler((actual, expected) => {
  // asserting the two objects are equal - required
  // for TestScheduler assertions to work via your test framework
  // e.g. using chai.
  expect(actual).deep.equal(expected);
});

// This test runs synchronously.
it("generates the stream correctly", () => {
  testScheduler.run((helpers) => {
    const { cold, time, expectObservable, expectSubscriptions } = helpers;
    const e1 = cold(" -a--b--c---|");
    const e1subs = "  ^----------!";
    const t = time("   ---|       "); // t = 3
    const expected = "-a-----c---|";

    expectObservable(e1.pipe(throttleTime(t))).toBe(expected);
    expectSubscriptions(e1.subscriptions).toBe(e1subs);
  });
});
`,
  ],
});
